package com.miku.blog.controller;

import com.miku.blog.annotation.SystemLog;
import com.miku.blog.domain.pojo.ResponseResult;
import com.miku.blog.domain.pojo.SystemConstance;
import com.miku.blog.service.TalkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;

/**
 * @author shkstart
 * @create ${}YEAR-06-10 10:50
 */
@Api(tags = "Blog[说说]")
@RestController
public class TalkController {

    @Autowired
    private TalkService talkService;

    @SystemLog(notes = "获取说说列表{前台博客系统}")
    @ApiOperation(value = "获取说说列表接口",notes = "获取说说列表相关数据，分页展示 公开的说说")
    @GetMapping("/talks")
    public ResponseResult getTalks(@RequestParam("current") Integer current,
                                   @RequestParam("size") Integer size)
    {
        return talkService.getTalks(current,size);
    }

    @SystemLog(notes = "获取说说详情{前台博客系统}")
    @ApiOperation(value = "获取说说详情接口",notes = "根据说说ID 获取说说详细信息{点赞量、评论量...}")
    @GetMapping("/talks/{talkId}")
    public ResponseResult getTalkDetailById(@PathVariable("talkId")Integer talkId)
    {
        return talkService.getTalkDetailById(talkId);
    }


    @SystemLog(notes = "获取说说内容列表{前台博客系统}")
    @ApiOperation(value = "获取说说内容列表接口",notes = "获取说说内容列表 首页轮播展示")
    @GetMapping("/home/talks")
    public ResponseResult getTalkContents()
    {
        return talkService.getTalkContents();
    }


}
